const EventEmitter = require('events');

class MyEmitter extends EventEmitter {}

const myEmitter = new MyEmitter();
myEmitter.on('event', (data) => {
    console.log('an event occurred!data:'+data);
});
myEmitter.emit('event',111);